package com.lz.football.module.ladderMatch.exchange
{
	import com.common.utils.Reflection;
	import com.liangzhong.model.goods.vo.GoodsVo;
	
	import flash.display.Bitmap;
	import flash.display.MovieClip;

	/**
	 *荣誉item 
	 * @author Administrator
	 * 
	 */	
	public class ExchangeItem extends ExchangeBaseItem//Sprite implements IComponent
	{
		
		/**
		 *荣誉图标  
		 */
		private var _honourIcon:MovieClip;
		public function ExchangeItem()
		{
			super();
			initUI();
		}
		
		override public function initUI(view:Object=null):void
		{
			symbolSkin = Reflection.createInstance("com.football.stadium.exchangeItem");
		
			super.initUI();
			_honourIcon = symbolSkin._honourIcon;
			_honourIcon.visible = false;
			this.addChild(symbolSkin);
			addEvtListener();
		}
		
		/**
		 *显示数据 
		 * @param $vo
		 * 
		 */
		override public function setDate($vo:GoodsVo):void
		{
			_vo =  $vo;
//			if(_vo.honour <= 0)
//				return;
			if(_image == null)_image= new Bitmap();
			_image.bitmapData = $vo.bitmapData
			_picture.addChild(_image);
			_goodName.text = $vo.name;
			_value.text = ""+$vo.honour;
			_honourIcon.visible = true;
			addEvtListener();
			
		}
		/**
		 * 重置
		 * 
		 */
		override public function reSet():void
		{
			removeEvtListener();
			select = false;
			_honourIcon.visible = false;
			_goodName.text = "";
			_value.text = "";
			if(_image != null && _image.parent)_picture.removeChild(_image);
		}
		
		
		
		override public function destroyView():void
		{
			removeEvtListener();
			_image = null;
			_callBack = null;
			_frame = null;
			_picture = null;
			
		}
		
	}
}